<template>
  <div id="login">
    <Particles
      class="lizi"
      id="tsparticles"
      :particlesInit="particlesInit"
      :particlesLoaded="particlesLoaded"
      :options="options"
    />

    <div class="Login">
      <div class="Login_title">Not Found</div>
      <div class="NotFound">
        404

        <button @click="GoHome()" class="GoHome">Go Home</button>
      </div>

      <div class="Login-form">
        <svg
          class="waves"
          viewBox="0 24 150 28"
          preserveAspectRatio="none"
          shape-rendering="auto"
        >
          <defs>
            <path
              id="gentle-wave"
              d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"
            ></path>
          </defs>
          <g class="parallax">
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="7"
              fill="rgb(255 255 255 / 1)"
            ></use>
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="0"
              fill="rgb(255 255 255 / 0.7)"
            ></use>
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="3"
              fill="rgb(255 255 255 / 0.5)"
            ></use>
            <use
              xlink:href="#gentle-wave"
              x="48"
              y="5"
              fill="rgb(255 255 255 / 0.3)"
            ></use>
          </g>
        </svg>
        <div class="Login-bottom"></div>
      </div>
    </div>

    <!-- <div class="HaiLang">
      <svg
        class="waves"
        viewBox="0 24 150 28"
        preserveAspectRatio="none"
        shape-rendering="auto"
      >
        <defs>
          <path
            id="gentle-wave"
            d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"
          ></path>
        </defs>
        <g class="parallax">
          <use
            xlink:href="#gentle-wave"
            x="48"
            y="7"
            fill="rgb(255 255 255 / 1)"
          ></use>
          <use
            xlink:href="#gentle-wave"
            x="48"
            y="0"
            fill="rgb(255 255 255 / 0.7)"
          ></use>
          <use
            xlink:href="#gentle-wave"
            x="48"
            y="3"
            fill="rgb(255 255 255 / 0.5)"
          ></use>
          <use
            xlink:href="#gentle-wave"
            x="48"
            y="5"
            fill="rgb(255 255 255 / 0.3)"
          ></use>
        </g>
      </svg>
      <div class="bottom"></div>
    </div> -->
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import { loadFull } from "tsparticles";
import type { Engine } from "tsparticles-engine";
import router from "@/router";

const particlesInit = async (engine: Engine) => {
  await loadFull(engine);
};
const GoHome = () => {
  router.push("/index");
};
const particlesLoaded = async (container: any) => {
  console.log("Particles container loaded", container);
};
const options = reactive({
  background: {
    color: {
      value: "#0d47a1",
    },
    position: "50% 50%",
    repeat: "no-repeat",
    size: "cover",
  },
  fullScreen: {
    zIndex: 1,
  },
  interactivity: {
    events: {
      onClick: {
        enable: true,
        mode: "repulse",
      },
      onHover: {
        enable: true,
        mode: "bubble",
      },
    },
    modes: {
      bubble: {
        distance: 400,
        duration: 0.3,
        opacity: 1,
        size: 4,
        divs: {
          distance: 200,
          duration: 0.4,
          mix: false,
          selectors: [],
        },
      },
      grab: {
        distance: 400,
        links: {
          opacity: 0.5,
        },
      },
      repulse: {
        divs: {
          distance: 200,
          duration: 0.4,
          factor: 100,
          speed: 1,
          maxSpeed: 50,
          easing: "ease-out-quad",
          selectors: [],
        },
      },
    },
  },
  particles: {
    links: {
      color: {
        value: "#ffffff",
      },
      distance: 500,
      opacity: 0.4,
      width: 2,
    },
    move: {
      attract: {
        rotate: {
          x: 600,
          y: 1200,
        },
      },
      direction: "bottom",
      enable: true,
      outModes: {
        bottom: "out",
        left: "out",
        right: "out",
        top: "out",
      },
    },
    number: {
      density: {
        enable: true,
      },
      value: 400,
    },
    opacity: {
      random: {
        enable: true,
      },
      value: {
        min: 0.1,
        max: 0.5,
      },
      animation: {
        speed: 1,
        minimumValue: 0.1,
      },
    },
    size: {
      random: {
        enable: true,
      },
      value: {
        min: 1,
        max: 10,
      },
      animation: {
        speed: 40,
        minimumValue: 0.1,
      },
    },
  },
});
</script>


<style scoped>
.GoHome {
  width: 500px;

  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  font-size: 20px;
  padding: 15px 10px;
  margin: 30px;
  border-radius: 3px;
  cursor: pointer;
}
.GoHome:hover {
  color: #409eff;
  background: #fff;
}
.NotFound {
  width: 100%;
  height: 400px;
  color: #fff;
  font-size: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  letter-spacing: 40px;
  flex-direction: column;
}
.lizi {
  width: 100%;
  height: 100vh;
  position: fixed;
  left: 0px;
  top: 0px;
}
#login {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.HaiLang {
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 500;
}
.bottom {
  height: 10px;
  background: #fff;
}
.waves {
  margin: 0;
  margin-bottom: -5px;
}

.parallax > use {
  animation: move 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.parallax > use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 10s;
}

.parallax > use:nth-child(2) {
  animation-delay: -3s;
  animation-duration: 15s;
}

.parallax > use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 20s;
}

.parallax > use:nth-child(4) {
  animation-delay: -5s;
  animation-duration: 25s;
}

@keyframes move {
  0% {
    transform: translate3d(-90px, 0, 0);
  }

  100% {
    transform: translate3d(85px, 0, 0);
  }
}

.Login {
  width: 100vw;

  height: 100vh;
  /* border: 5px solid #fff; */
  z-index: 999;
  box-shadow: 0px 0px 20px #fff;
  border-radius: 10px;
  overflow: hidden;
}

.Login_title {
  width: 100%;
  height: 200px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 50px;
  letter-spacing: 3px;
  font-weight: bold;
}

.Login-bottom {
  width: 100%;
  height: calc(100vh - 100px);
  background-color: #fff;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-direction: column;
}

.LIZI {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  height: 100%;
}
</style>